#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2024/9/6 11:11
# @File           : vendor
# @IDE            : PyCharm
# @desc           : 描述

from sqlalchemy.orm import Mapped, mapped_column
from db.db_base import BaseModel, AuditModel
from sqlalchemy import JSON, String, Boolean, Text, UniqueConstraint


class DCRule(AuditModel):
    __tablename__ = "dc_dispatch_rule"
    __table_args__ = (
        {'comment': '解析规则'}
    )

    rule_type: Mapped[str] = mapped_column(String(20), comment="规则类型")

    rule_name: Mapped[str] = mapped_column(String(40), comment="规则名")
    rules: Mapped[list] = mapped_column(JSON, default=[], comment="规则项")

    remark: Mapped[str] = mapped_column(Text, nullable=True, comment="备注")
    is_active: Mapped[bool] = mapped_column(Boolean, default=True, comment="是否启用")
